﻿<%@page import="com.cchr.acms.model.Action"%>
<%@page import="com.cchr.acms.model.AbuseType"%>
<%@page import="com.cchr.acms.util.HtmlComponentUtil.SelectOption"%>
<%@page import="java.util.List"%>
<%@page import="com.cchr.acms.util.HtmlComponentUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
	String contextPath = request.getContextPath();
%>

	<form class="panel form-horizontal" id="jq-validation-form" method="POST" style="width:1000px; color:black;">
		<div class="row">
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
				</div>
			</div>
			<div class="col-sm-8">
				<div class="form-group no-margin-hr" style="text-align:center; margin-top:-25px">
					<label class="control-label"><h2>Case No:${caseInfo.caseNo}</h2></label>
				</div>
			</div>
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
					<c:if test="${caseInfo.status != '5' and caseInfo.status != '6'}">
						<a id="editBtn" class="btn btn-primary" style="width:80px;border-radius:10px;" href="<%=contextPath%>/case/edit/${caseInfo.id}">EDIT</a>
					</c:if>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
				</div>
			</div>
			<div class="col-sm-8">
				<div class="form-group no-margin-hr" style="text-align:center; margin-top:-25px">
					<label class="control-label"><h2>${caseInfo.abusedPerson.firstName.concat(' ')}${caseInfo.abusedPerson.middleName.concat(' ')}${caseInfo.abusedPerson.lastName}</h2></label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
				</div>
			</div>
			<div class="col-sm-8">
				<div class="form-group no-margin-hr" style="text-align:center; margin-top:-25px">
					<label class="control-label"><h2>Initial Contact:<fmt:formatDate value="${caseInfo.createDate}" pattern="MM/dd/yyyy"/></h2></label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h3 style="margin-bottom:10px; margin-top:10px" class="form-header">Abused Person's Info:</h3></label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="detail-info">
					<label>${caseInfo.abusedPerson.firstName.concat(' ')}${caseInfo.abusedPerson.middleName.concat(' ')}${caseInfo.abusedPerson.lastName}</label>
				</div>
			</div>
		</div>
		<c:if test="${!empty caseInfo.abusedPerson.streetAddress }">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>${caseInfo.abusedPerson.streetAddress.concat(' ')}</label>
					</div>
				</div>
			</div>
		</c:if>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="detail-info">
					<label>${caseInfo.abusedPerson.city.concat(', ')}${caseInfo.abusedPerson.state.concat(' ')}${caseInfo.abusedPerson.zip}</label>
				</div>
			</div>
		</div>
		<c:if test="${!empty caseInfo.abusedPerson.country }">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>${caseInfo.abusedPerson.country}</label>
					</div>
				</div>
			</div>
		</c:if>
		<br>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-3">
				<div class="detail-info">
					<label>${'Tel: '.concat(caseInfo.abusedPerson.telephone)}</label>
				</div>
			</div>
			<div class="col-sm-5">
				<div class="detail-info">
					<label>Email: ${caseInfo.abusedPerson.email}</label>
				</div>
			</div>
		</div>
		<br>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="detail-info">
					<label>
						<c:if test="${!empty caseInfo.abusedPerson.birthDay }">
							Birthday: <fmt:formatDate value="${caseInfo.abusedPerson.birthDay}" pattern="MM/dd/yyyy"/>,
						</c:if>
						 approx. ${caseInfo.abusedPerson.age} years old
					</label>
				</div>
			</div>
		</div>
		<br>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="detail-info">
					<label>Date Abuse Occurred: 
					<c:if test="${!empty caseInfo.caseStart }">
						<fmt:formatDate value="${caseInfo.caseStart}" pattern="MM/dd/yyyy"/> - 
					</c:if>
					<fmt:formatDate value="${caseInfo.caseEnd}" pattern="MM/dd/yyyy"/></label>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h3 style="margin-bottom:10px; margin-top:10px" class="form-header">Person Reporting the Abuse: </h3></label>
				</div>
			</div>
		</div>
		<c:if test="${!empty caseInfo.reportedBy.firstName or !empty caseInfo.reportedBy.middleName or !empty caseInfo.reportedBy.lastName or !empty caseInfo.reportedBy.relationOther or !empty caseInfo.reportedBy.relation }">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>
							<c:if test="${!empty caseInfo.reportedBy.firstName or !empty caseInfo.reportedBy.middleName or !empty caseInfo.reportedBy.lastName  }">
								${caseInfo.reportedBy.firstName} ${caseInfo.reportedBy.middleName} ${caseInfo.reportedBy.lastName}
								 - 
							</c:if>
							<c:choose>
								<c:when test="${empty caseInfo.reportedBy.relation }">
									${caseInfo.reportedBy.relationOther}
								</c:when>
								<c:otherwise>
									${caseInfo.reportedBy.relation}
								</c:otherwise>
							</c:choose>
						</label>
					</div>
				</div>
			</div>
		</c:if>
		<c:if test="${!empty caseInfo.reportedBy.streetAddress }">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>${caseInfo.reportedBy.streetAddress}</label>
					</div>
				</div>
			</div>
		</c:if>
		<c:if test="${!empty caseInfo.reportedBy.city or !empty caseInfo.reportedBy.state or !empty caseInfo.reportedBy.zip }">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>
						<c:if test="${!empty caseInfo.reportedBy.city }">
							${caseInfo.reportedBy.city.concat(', ')}
						</c:if>
						${caseInfo.reportedBy.state} ${caseInfo.reportedBy.zip}</label>
					</div>
				</div>
			</div>
		</c:if>
		<c:if test="${!empty caseInfo.reportedBy.country }">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>${caseInfo.reportedBy.country}</label>
					</div>
				</div>
			</div>
		</c:if>
		<c:if test="${!empty caseInfo.reportedBy.telephone or !empty caseInfo.reportedBy.email }">
			<br>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-3">
					<div class="detail-info">
						<label>Tel: ${caseInfo.reportedBy.telephone}</label>
					</div>
				</div>
				<div class="col-sm-5">
					<div class="detail-info">
						<label>Email: ${caseInfo.reportedBy.email}</label>
					</div>
				</div>
			</div>
		</c:if>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h3 style="margin-bottom:10px; margin-top:10px" class="form-header">Type of Abuse: </h3></label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="detail-info">
					<label>${typeIds }</label>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h3 style="margin-bottom:10px; margin-top:10px" class="form-header">Summary of Abuse: </h3></label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="detail-info">
					<label style="word-break:break-all;"> ${caseInfo.summary }</label>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h3 style="margin-bottom:10px; margin-top:10px" class="form-header">Mental Health Facilities Involved with the Abuse: </h3></label>
				</div>
			</div>
		</div>
		<c:forEach var="facilityInfo" items="${caseInfo.facilityInfos }" varStatus="status">  
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<h4>Facility ${status.count}:</h4>
					</div>
				</div>
			</div>
			<c:choose>
				<c:when test="${empty facilityInfo.name }">
					<div class="row">
						<div class="col-sm-offset-2 col-sm-10">
							<div class="detail-info">
								<label>
								N/A
								</label>
							</div>
						</div>
					</div>
				</c:when>
				<c:otherwise>
					<div class="row">
						<div class="col-sm-offset-2 col-sm-10">
							<div class="detail-info">
								<label>
									${facilityInfo.name}, 
									<c:choose>
										<c:when test="${facilityInfo.type == 'Other' }">
											${facilityInfo.typeOther}
										</c:when>
										<c:otherwise>
											${facilityInfo.type}
										</c:otherwise>
									</c:choose>
								</label>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-sm-offset-2 col-sm-10">
							<div class="detail-info">
								<label>
								<c:if test="${!empty facilityInfo.streetAddress }">
									${facilityInfo.streetAddress}, 
								</c:if>
								<c:if test="${!empty facilityInfo.city }">
									${facilityInfo.city}, 
								</c:if>
								${facilityInfo.state} ${facilityInfo.zip}</label>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-sm-offset-2 col-sm-10">
							<div class="detail-info">
								<label>${facilityInfo.country}</label>
							</div>
						</div>
					</div>
					<c:if test="${!empty facilityInfo.telephone }">
						<div class="row">
							<div class="col-sm-offset-2 col-sm-10">
								<div class="detail-info">
									<label>Tel: ${facilityInfo.telephone}</label>
								</div>
							</div>
						</div>
					</c:if>
				</c:otherwise>
			</c:choose>
		</c:forEach>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label"><h3 style="margin-bottom:10px; margin-top:10px" class="form-header">Doctor Info: </h3></label>
				</div>
			</div>
		</div>
		<c:forEach var="doctorInfo" items="${caseInfo.doctorInfos }" varStatus="status"> 
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<h4>Doctor ${status.count}:</h4>
					</div>
				</div>
			</div>
			<c:choose>
				<c:when test="${empty doctorInfo.name }">
					<div class="row">
						<div class="col-sm-offset-2 col-sm-10">
							<div class="detail-info">
								<label>
								N/A
								</label>
							</div>
						</div>
					</div>
				</c:when>
				<c:otherwise>
					<div class="row">
						<div class="col-sm-offset-2 col-sm-10">
							<div class="detail-info">
								<label>
									<c:if test="${!empty doctorInfo.name }">
										${doctorInfo.name} 
									</c:if>
									<c:if test="${!empty doctorInfo.lastName }">
										${doctorInfo.lastName}, 
									</c:if>
									${doctorInfo.docType}
								</label>
							</div>
						</div>
					</div>
					<c:if test="${!empty doctorInfo.streetAddress or !empty doctorInfo.city or !empty doctorInfo.state or !empty doctorInfo.zip }">
						<div class="row">
							<div class="col-sm-offset-2 col-sm-10">
								<div class="detail-info">
									<label>
										<c:if test="${!empty doctorInfo.streetAddress }">
											${doctorInfo.streetAddress},
										</c:if>
										<c:if test="${!empty doctorInfo.city }">
											${doctorInfo.city}, 
										</c:if>
										${doctorInfo.state} ${doctorInfo.zip}</label>
								</div>
							</div>
						</div>
					</c:if>
					<c:if test="${!empty doctorInfo.country }">
						<div class="row">
							<div class="col-sm-offset-2 col-sm-10">
								<div class="detail-info">
									<label>${doctorInfo.country}</label>
								</div>
							</div>
						</div>
					</c:if>
					<c:if test="${!empty doctorInfo.telephone}">
						<div class="row">
							<div class="col-sm-offset-2 col-sm-10">
								<div class="detail-info">
									<label>Tel: ${doctorInfo.telephone}</label>
								</div>
							</div>
						</div>
					</c:if>
				</c:otherwise>
			</c:choose>
		</c:forEach>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Psychiatric Drugs Prescribed: 
						</h3>
					</label>
				</div>
			</div>
		</div>
		<c:if test="${caseInfo.drugsPrescribed == '1'}">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>
							<c:forEach var="drugName" items="${drugNames }" varStatus="status">
								<c:if test="${status.count != 1}">
								,
								</c:if> 
								${drugName}
							</c:forEach>
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group no-margin-hr">
						<label class="control-label">
							<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
								Still Taking Psychiatric Drugs? 
									<c:choose>
										<c:when test="${caseInfo.stillTakeDrugs == '1' }">
											Yes
										</c:when>
										<c:otherwise>
											No
										</c:otherwise>
									</c:choose>
							</h3>
						</label>
					</div>
				</div>
			</div>
		</c:if>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Are They Working With an Attorney? 
								<c:choose>
									<c:when test="${caseInfo.attorney.workWithAttorney == '1' }">
										Yes
									</c:when>
									<c:otherwise>
										No
									</c:otherwise>
								</c:choose>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<c:if test="${caseInfo.attorney.workWithAttorney == '1'}">
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group no-margin-hr">
						<label class="control-label">
							<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
								Attorney Info: 
							</h3>
						</label>
					</div>
				</div>
			</div>
			<c:if test="${!empty caseInfo.attorney.name}">
				<div class="row">
					<div class="col-sm-offset-1 col-sm-11">
						<div class="detail-info">
							<label>${caseInfo.attorney.name }</label>
						</div>
					</div>
				</div>
			</c:if>
			<c:if test="${!empty caseInfo.attorney.streetAddress or !empty caseInfo.attorney.city or !empty caseInfo.attorney.state or !empty caseInfo.attorney.zip  }">
				<div class="row">
					<div class="col-sm-offset-1 col-sm-11">
						<div class="detail-info">
							<label>
							<c:if test="${!empty caseInfo.attorney.streetAddress}">
								${caseInfo.attorney.streetAddress}, 
							</c:if>
							<c:if test="${!empty caseInfo.attorney.city}">
								${caseInfo.attorney.city}, 
							</c:if>
							${caseInfo.attorney.state} ${caseInfo.attorney.zip}</label>
						</div>
					</div>
				</div>
			</c:if>
			<c:if test="${!empty caseInfo.attorney.telephone or !empty caseInfo.attorney.email  }">
				<div class="row">
					<div class="col-sm-offset-1 col-sm-11">
						<div class="detail-info">
							<label>
							<c:if test="${!empty caseInfo.attorney.telephone}">
								${caseInfo.attorney.telephone}, 
							</c:if>
							${caseInfo.attorney.email}</label>
						</div>
					</div>
				</div>
			</c:if>
		</c:if>
		<c:choose>
			<c:when test="${caseInfo.attorney.assistanceAttorney == '1' and caseInfo.attorney.workWithAttorney != '1'}">
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group no-margin-hr">
							<label class="control-label" style="margin-top:-50px;">
								<h3 class="form-header" style="margin-bottom:10px;">
									Would Like Assistance in Getting an Attorney to File Charges or Represent Your Case?
									<div style="text-align:left">
										Yes, the person wants assistance finding an attorney。
									</div>
								</h3>
							</label>
						</div>
					</div>
				</div>
			</c:when>
		</c:choose>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							What Actions Are They Interested in Taking on This Case?
						</h3>
					</label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="form-group no-margin-hr">
					<ul style="margin:0px;padding:0px">
						<c:forEach var="action" items="${actions }" varStatus="status">
							<li>
								<strong>${action }</strong>
							</li>
						</c:forEach>
						<c:if test="${! empty caseInfo.otherAction}">
							<li>
								<strong>${caseInfo.otherAction }</strong>
							</li>
						</c:if>
					</ul>
				</div>
			</div>
		</div>
		<hr>
		<c:if test="${! empty caseInfo.bestTimeToContact}">
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group no-margin-hr">
						<label class="control-label">
							<h3 style="margin-bottom:0px; margin-top:0px" class="form-header">
								Best Time Contact:  ${caseInfo.bestTimeToContact}
							</h3>
						</label>
					</div>
				</div>
			</div>
		</c:if>
		<c:if test="${! empty caseInfo.bestWayToContact}">
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group no-margin-hr">
						<label class="control-label">
							<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
								Best Way to Contact:  ${caseInfo.bestWayToContact}
							</h3>
						</label>
					</div>
				</div>
			</div>
		</c:if>
		</form>
<!-- Get jQuery from Google CDN -->
<!--[if !IE]> -->
	<script type="text/javascript"> window.jQuery || document.write('<script src="<%=contextPath%>/assets/javascripts/jquery-2.0.3.min.js">'+"<"+"/script>"); </script>
<!-- <![endif]-->
<!--[if lte IE 9]>
	<script type="text/javascript"> window.jQuery || document.write('<script src="<%=contextPath%>/assets/javascripts/jquery-1.8.3.min.js">'+"<"+"/script>"); </script>
<![endif]-->